package com.tgy.myplus.githubLearn;


public class Person {
    private String name = "666";
//    public String name;
    private int age;

    /**
     * 构造类，实例化类自动执行
     */
    public Person (){
        System.out.println("hello");
    }
    public void say(){
        System.out.println("hi");
    }

    private String getName() {
        return name;
    }

    public Person setName(String name) {
        this.name = name;
        return this;
    }

    public int getAge() {
        return age;
    }

    public Person setAge(int age) {
        this.age = age;
        return this;
    }

    //只能在类的内部被访问，不用创建实例对象就能访问对象
    static void sayWords (String name){
        System.out.println(name);
    }

    public static void main(String[] args) {
        //Person.sayWords(args[0]);
        Person person =new Person();
        person.setAge(6);
        person.say();
        System.out.println(person.getName());
    }
}
